package system

import (
	"k8s-admin/dao/system"
	"k8s-admin/models"
)

type InterfaceUsers interface {
	//Register(user *models.User) error
	Login(username, password string) (*models.RespUser, error)
}
type userInfo struct{}

func NewUserInfo() InterfaceUsers {
	return &userInfo{}
}

//func (i *userInfo) Register(user *models.User) error {
//	err := system.NewUserInterface().Register(user)
//	if err != nil {
//		return err
//	} else {
//		return nil
//	}
//}

func (i *userInfo) Login(username, password string) (*models.RespUser, error) {
	login, err := system.NewUserInterface().Login(username, password)
	if err != nil {
		return nil, err
	} else {
		return login, nil
	}
}
